import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Home from '../views/Home.vue'
import Animals from '../components/Animals.vue'
import Cake from '../components/Cake.vue'
import Text from '../components/Text.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Index
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    redirect: '/animals',
    children: [{
      path: '/animals',
      component: Animals
    },
    {
      path: '/cake',
      component: Cake,
      children: [{
        path: '/cake/text',
        component: Text
      }]
    }]
  }
]

const router = new VueRouter({
  routes
})

export default router
